<?php
	require_once('client_config.php');
	require_once('ntml_soapclient.php');
	$client = new MyNTMLSoapClient('./ews/services.wsdl', $soap_options);
	$client->set_profile($user_profile['login'], $user_profile['password']);
	$appointment = $client->get_appointment('AAAcAEFkbWluaXN0cmF0b3JAbGl0d2FyZWluYy5jb20ARgAAAAAAL24NVxKY8U2o5Htf7ap4pQcAHdSs6DA91U+H3VPaWSZwgQAB89dGiQAACYi0iw5NBUKENHwoNXb9AgSUGvp/VgAA',&$errno, &$error);
	echo "<table border='1'>";
	echo "<thr>";
	echo "<td>Subject</td>";
	echo "<td>Description</td>";
	echo "<td>Categories</td>";
	echo "<td>Start date</td>";
	echo "<td>End date</td>";
	echo "<td>Id</td>";
	echo "</thr>";

	echo $appointment->display_as_row();

	echo "</table>";
	echo $errno;
	echo $error;
	exit;
	// create the GetItem request
	$getItemRequest = new GetItemType();
	$getItemRequest->ItemShape->BaseShape = 'AllProperties'; // IdOnly,
	$getItemRequest->ItemShape->IncludeMimeContent = 'true';
	$getItemRequest->ItemShape->BodyType = 'HTML'; // Best, HTML, Text
	$getItemRequest->ItemIds->ItemId[0]->Id = 'AAAcAEFkbWluaXN0cmF0b3JAbGl0d2FyZWluYy5jb20ARgAAAAAAL24NVxKY8U2o5Htf7ap4pQcAHdSs6DA91U+H3VPaWSZwgQAB89dGiQAACYi0iw5NBUKENHwoNXb9AgSUGvp/QgAA';


try{
    // Send the request and get the response.
    $getItemResponse = new GetItemResponseType();
    $getItemResponse = $client->GetItem(new SoapParam($getItemRequest, 'GetItemType'));
	// Get response information and display
	$html .= "<font color='blue'>";
    $html .= "Response Code: " . $getItemResponse->ResponseCode . " ( <font color='red'>" . $findItemResponseMessage->MessageText ." </font>)<br>";
    $html .= "Response Class: " . $getItemResponse->ResponseClass . "<br>";
    $itemInfo = $getItemResponse->ResponseMessages->GetItemResponseMessage;
    foreach($itemInfo->Items as $item){
    	$html .= CalendarItemType2HTML($item);
	}
	$html .= "</font>";
	echo $html;
}catch(SoapFault $e){
	echo "<font color='red' ><b>" . $e->getMessage() . "</b></font>";
};



?>